const { createProxyMiddleware: proxy } = require('http-proxy-middleware');
module.exports = (app) => {
    app.use(
        '/posts',
        proxy(
            {
                target: "http://localhost:4400/",
                changeOrigin: true,
            }
        )
    );
    app.use(
        '/api',
        proxy(
            {
                target: "http://localhost:6666/",
                changeOrigin: true,
            }
        )
    );

    app.use(
        '/leaver',
        proxy(
            {
                target: "http://localhost:4400/",
                changeOrigin: true,
            }
        )

    );
    app.use(
        '/hometotal',
        proxy(
            {
                target: "http://localhost:4400/",
                changeOrigin: true,
            }
        )

    );
    app.use(
        '/homecollege',
        proxy(
            {
                target: "http://localhost:4400/",
                changeOrigin: true,
            }
        )

    );
    app.use(
        '/homeclass',
        proxy(
            {
                target: "http://localhost:4400/",
                changeOrigin: true,
            }
        )

    );
    app.use(
        '/datalist',
        proxy(
            {
                target: "http://localhost:4400/",
                changeOrigin: true,
            }
        )

    );

    app.use(
        '/studentlist',
        proxy(
            {
                target: "http://localhost:4400/",
                changeOrigin: true,
            }
        )

    );
    app.use(
        '/homexiandata',
        proxy(
            {
                target: "http://localhost:4400/",
                changeOrigin: true,
            }
        )

    );
    app.use(
        '/trip',
        proxy(
            {
                target: "http://localhost:4400/",
                changeOrigin: true,
            }
        )

    );
    app.use(
        '/health',
        proxy(
            {
                target: "http://localhost:4400/",
                changeOrigin: true
            }
        )
    );
    app.use(
        '/upload',
        proxy({
            target:
                "http://localhost:4400/",
            changeOrigin: true
        })
    )

}